from .models import *
from rest_framework import serializers


class AndonCallSerializer(serializers.ModelSerializer):
    class Meta:
        model = HelpCallHistory
        fields = [
            "start_time",
            "end_time",
            "during_time",
            "point_id",
            "during_time1",
            "sub_area",
            "equipment_id",
            "shift",
            "call_type",
        ]


class MachineFaultHistorySerializer(serializers.ModelSerializer):
    class Meta:
        model = FltHistory
        fields = [
            "start_time",
            "end_time",
            "during_time",
            "point_id",
            "during_time1",
            "sub_area",
            "equipment_id",
            "shift",
            "call_type",
        ]


class StationStatusSerializer(serializers.ModelSerializer):
    class Meta:
        model = StrvBlkHistory
        fields = [
            "start_time",
            "end_time",
            "during_time",
            "point_id",
            "during_time1",
            "sub_area",
            "equipment_id",
            "shift",
            "call_type",
        ]


class EquipmentSerializer(serializers.ModelSerializer):
    class Meta:
        model = PointIdGd
        fields = [
            "point_id",
            "sub_area",
            "区域",
            "equipment_id",
        ]


class LastCtStatisticsSerializer(serializers.ModelSerializer):
    class Meta:
        model = LastCtStatistics
        fields = [
            "production_date",
            "shift",
            "hour",
            "point_id",
            "sub_area",
            "equipment_id",
            "节拍",
        ]


class ToolChangeLogSerializer(serializers.ModelSerializer):
    class Meta:
        model = ToolChangeLog
        fields = ["timestamp", "project", "sub_area", "equipment", "serial_number", "shift"]


class ScheduleSerializer(serializers.ModelSerializer):
    class Meta:
        model = Schedule
        fields = [
            "sub_area",
            "production_date",
            "shift",
            "shift_start_time",
            "shift_end_time",
            "crew",
            "break_1_start",
            "break_1_end",
            "break_2_start",
            "break_2_end",
            "break_3_start",
            "break_3_end",
            "break_4_start",
            "break_4_end",
            "break_5_start",
            "break_5_end",
        ]


class ProductionHourlySerializer(serializers.ModelSerializer):
    class Meta:
        model = GdNow
        fields = [
            "production_date",
            "point_id",
            "shift",
            "hour_1",
            "hour_2",
            "hour_3",
            "hour_4",
            "hour_5",
            "hour_6",
            "hour_7",
            "hour_8",
            "hour_9",
            "hour_10",
            "hour_11",
            "hour_12",
            "sum",
        ]


class LastCtSerializer(serializers.ModelSerializer):
    class Meta:
        model = LastCt
        fields = [
            "timestamp",
            "timestamp_utc",
            "point_id",
            "field_prev",
            "field_val",
            "field_time",
            "field_time_utc",
        ]


class AS_LastCt_filterSerializer(serializers.ModelSerializer):
    class Meta:
        model = ValOvertwoOoandlessoneOoo
        fields = [
            "timestamp",
            "point_id",
            "field_val",
            "field_val",
            "field_prev",
        ]


class MS_LastCt_filterSerializer(serializers.ModelSerializer):
    class Meta:
        model = MsLastCtFilter
        fields = [
            "timestamp",
            "point_id",
            "field_val",
            "field_val",
            "field_prev",
        ]


class LoopA_hourly_productionSerializer(serializers.ModelSerializer):
    timestamp = models.DateTimeField(blank=True, null=True)
    timestamp_utc = models.DateTimeField()
    OP1006 = serializers.IntegerField(source="mpcascas011006_d_gd_val0")
    OP1008 = serializers.IntegerField(source="mpcascas011008_d_gd_val0")
    OP1010 = serializers.IntegerField(source="mpcascas011010_d_gd_val0")
    OP1020 = serializers.IntegerField(source="mpcascas011020_d_gd_val0")
    OP1030 = serializers.IntegerField(source="mpcascas011030_d_gd_val0")
    OP1035 = serializers.IntegerField(source="mpcascas011035_d_gd_val0")
    OP1040 = serializers.IntegerField(source="mpcascas011040_d_gd_val0")
    OP1050 = serializers.IntegerField(source="mpcascas011050_d_gd_val0")
    OP1055 = serializers.IntegerField(source="mpcascas011055_d_gd_val0")
    OP1060 = serializers.IntegerField(source="mpcascas011060_d_gd_val0")
    OP1070 = serializers.IntegerField(source="mpcascas011070_d_gd_val0")
    OP1075 = serializers.IntegerField(source="mpcascas011075_d_gd_val0")
    OP1080 = serializers.IntegerField(source="mpcascas011080_d_gd_val0")
    OP1090 = serializers.IntegerField(source="mpcascas011090_d_gd_val0")
    OP1095 = serializers.IntegerField(source="mpcascas011095_d_gd_val0")
    OP1096 = serializers.IntegerField(source="mpcascas011096_d_gd_val0")
    OP1100 = serializers.IntegerField(source="mpcascas011100_d_gd_val0")
    OP1110 = serializers.IntegerField(source="mpcascas011110_d_gd_val0")
    OP1115 = serializers.IntegerField(source="mpcascas011115_d_gd_val0")
    OP1120 = serializers.IntegerField(source="mpcascas011120_d_gd_val0")
    OP1126 = serializers.IntegerField(source="mpcascas011126_d_gd_val0")
    OP1130 = serializers.IntegerField(source="mpcascas011130_d_gd_val0")
    OP1140 = serializers.IntegerField(source="mpcascas011140_d_gd_val0")
    OP1150 = serializers.IntegerField(source="mpcascas011150_d_gd_val0")
    OP1160 = serializers.IntegerField(source="mpcascas011160_d_gd_val0")
    OP1165 = serializers.IntegerField(source="mpcascas011165_d_gd_val0")
    OP1170 = serializers.IntegerField(source="mpcascas011170_d_gd_val0")
    OP1180 = serializers.IntegerField(source="mpcascas011180_d_gd_val0")
    OP1190 = serializers.IntegerField(source="mpcascas011190_d_gd_val0")
    OP1195 = serializers.IntegerField(source="mpcascas011195_d_gd_val0")
    OP1196 = serializers.IntegerField(source="mpcascas011196_d_gd_val0")
    OP1200 = serializers.IntegerField(source="mpcascas011200_d_gd_val0")
    OP121a = serializers.IntegerField(source="mpcascas01121a_d_gd_val0")
    OP121b = serializers.IntegerField(source="mpcascas01121b_d_gd_val0")
    OP121c = serializers.IntegerField(source="mpcascas01121c_d_gd_val0")
    OP1220 = serializers.IntegerField(source="mpcascas011220_d_gd_val0")
    OP1230 = serializers.IntegerField(source="mpcascas011230_d_gd_val0")
    OP1235 = serializers.IntegerField(source="mpcascas011235_d_gd_val0")
    OP1240 = serializers.IntegerField(source="mpcascas011240_d_gd_val0")
    OP1245 = serializers.IntegerField(source="mpcascas011245_d_gd_val0")
    OP1250 = serializers.IntegerField(source="mpcascas011250_d_gd_val0")
    OP1260 = serializers.IntegerField(source="mpcascas011260_d_gd_val0")
    OP1261 = serializers.IntegerField(source="mpcascas011261_d_gd_val0")
    OP1265 = serializers.IntegerField(source="mpcascas011265_d_gd_val0")
    OP1266 = serializers.IntegerField(source="mpcascas011266_d_gd_val0")
    OP1270 = serializers.IntegerField(source="mpcascas011270_d_gd_val0")
    OP1275 = serializers.IntegerField(source="mpcascas011275_d_gd_val0")
    OP1280 = serializers.IntegerField(source="mpcascas011280_d_gd_val0")
    OP1290 = serializers.IntegerField(source="mpcascas011290_d_gd_val0")
    OP1300 = serializers.IntegerField(source="mpcascas011300_d_gd_val0")
    OP1310 = serializers.IntegerField(source="mpcascas011310_d_gd_val0")
    OP1315 = serializers.IntegerField(source="mpcascas011315_d_gd_val0")
    OP1320 = serializers.IntegerField(source="mpcascas011320_d_gd_val0")
    OP1330 = serializers.IntegerField(source="mpcascas011330_d_gd_val0")
    OP1340 = serializers.IntegerField(source="mpcascas011340_d_gd_val0")
    OP1355 = serializers.IntegerField(source="mpcascas011355_d_gd_val0")
    OP135a = serializers.IntegerField(source="mpcascas01135a_d_gd_val0")
    OP135b = serializers.IntegerField(source="mpcascas01135b_d_gd_val0")
    OP1360 = serializers.IntegerField(source="mpcascas011360_d_gd_val0")
    OP1366 = serializers.IntegerField(source="mpcascas011366_d_gd_val0")
    OP1368 = serializers.IntegerField(source="mpcascas011368_d_gd_val0")
    OP1370 = serializers.IntegerField(source="mpcascas011370_d_gd_val0")
    OP1380 = serializers.IntegerField(source="mpcascas011380_d_gd_val0")
    OP1390 = serializers.IntegerField(source="mpcascas011390_d_gd_val0")
    OP1405 = serializers.IntegerField(source="mpcascas011405_d_gd_val0")
    OP140a = serializers.IntegerField(source="mpcascas01140a_d_gd_val0")
    OP140b = serializers.IntegerField(source="mpcascas01140b_d_gd_val0")
    OP1410 = serializers.IntegerField(source="mpcascas011410_d_gd_val0")
    OP1416 = serializers.IntegerField(source="mpcascas011416_d_gd_val0")
    OP1420 = serializers.IntegerField(source="mpcascas011420_d_gd_val0")
    OP1430 = serializers.IntegerField(source="mpcascas011430_d_gd_val0")
    OP143a = serializers.IntegerField(source="mpcascas01143a_d_gd_val0")
    OP143b = serializers.IntegerField(source="mpcascas01143b_d_gd_val0")
    OP1445 = serializers.IntegerField(source="mpcascas011445_d_gd_val0")
    OP4010 = serializers.IntegerField(source="mpcascas014010_d_gd_val0")
    OP4020 = serializers.IntegerField(source="mpcascas014020_d_gd_val0")
    OP4050 = serializers.IntegerField(source="mpcascas014050_d_gd_val0")
    OP1053 = serializers.IntegerField(source="mpcascas011053_d_gd_val0")
    OP1058 = serializers.IntegerField(source="mpcascas011058_d_gd_val0")

    class Meta:
        model = GdAs01
        fields = [
            "timestamp",
            "timestamp_utc",
            "OP1006",
            "OP1008",
            "OP1010",
            "OP1020",
            "OP1030",
            "OP1035",
            "OP1040",
            "OP1050",
            "OP1055",
            "OP1060",
            "OP1070",
            "OP1075",
            "OP1080",
            "OP1090",
            "OP1095",
            "OP1096",
            "OP1100",
            "OP1110",
            "OP1115",
            "OP1120",
            "OP1126",
            "OP1130",
            "OP1140",
            "OP1150",
            "OP1160",
            "OP1165",
            "OP1170",
            "OP1180",
            "OP1190",
            "OP1195",
            "OP1196",
            "OP1200",
            "OP121a",
            "OP121b",
            "OP121c",
            "OP1220",
            "OP1230",
            "OP1235",
            "OP1240",
            "OP1245",
            "OP1250",
            "OP1260",
            "OP1261",
            "OP1265",
            "OP1266",
            "OP1270",
            "OP1275",
            "OP1280",
            "OP1290",
            "OP1300",
            "OP1310",
            "OP1315",
            "OP1320",
            "OP1330",
            "OP1340",
            "OP1355",
            "OP135a",
            "OP135b",
            "OP1360",
            "OP1366",
            "OP1368",
            "OP1370",
            "OP1380",
            "OP1390",
            "OP1405",
            "OP140a",
            "OP140b",
            "OP1410",
            "OP1416",
            "OP1420",
            "OP1430",
            "OP143a",
            "OP143b",
            "OP1445",
            "OP4010",
            "OP4020",
            "OP4050",
            "OP1053",
            "OP1058",
        ]


class LoopB_hourly_productionSerializer(serializers.ModelSerializer):
    timestamp = models.DateTimeField(blank=True, null=True)
    timestamp_utc = models.DateTimeField()
    OP2006 = serializers.IntegerField(source="mpcahcah012006_d_gd_val0")
    OP2010 = serializers.IntegerField(source="mpcahcah012010_d_gd_val0")
    OP2020 = serializers.IntegerField(source="mpcahcah012020_d_gd_val0")
    OP2030 = serializers.IntegerField(source="mpcahcah012030_d_gd_val0")
    OP2040 = serializers.IntegerField(source="mpcahcah012040_d_gd_val0")
    OP2050 = serializers.IntegerField(source="mpcahcah012050_d_gd_val0")
    OP2055 = serializers.IntegerField(source="mpcahcah012055_d_gd_val0")
    OP205a = serializers.IntegerField(source="mpcahcah01205a_d_gd_val0")
    OP205b = serializers.IntegerField(source="mpcahcah01205b_d_gd_val0")
    OP2060 = serializers.IntegerField(source="mpcahcah012060_d_gd_val0")
    OP2070 = serializers.IntegerField(source="mpcahcah012070_d_gd_val0")
    OP2080 = serializers.IntegerField(source="mpcahcah012080_d_gd_val0")
    OP2090 = serializers.IntegerField(source="mpcahcah012090_d_gd_val0")
    OP2100 = serializers.IntegerField(source="mpcahcah012100_d_gd_val0")
    OP2110 = serializers.IntegerField(source="mpcahcah012110_d_gd_val0")
    OP2115 = serializers.IntegerField(source="mpcahcah012115_d_gd_val0")
    OP2120 = serializers.IntegerField(source="mpcahcah012120_d_gd_val0")
    OP2135 = serializers.IntegerField(source="mpcahcah012135_d_gd_val0")
    OP213a = serializers.IntegerField(source="mpcahcah01213a_d_gd_val0")
    OP213b = serializers.IntegerField(source="mpcahcah01213b_d_gd_val0")
    OP2140 = serializers.IntegerField(source="mpcahcah012140_d_gd_val0")
    OP2145 = serializers.IntegerField(source="mpcahcah012145_d_gd_val0")
    OP2146 = serializers.IntegerField(source="mpcahcah012146_d_gd_val0")
    OP2150 = serializers.IntegerField(source="mpcahcah012150_d_gd_val0")
    OP2155 = serializers.IntegerField(source="mpcahcah012155_d_gd_val0")
    OP2160 = serializers.IntegerField(source="mpcahcah012160_d_gd_val0")
    OP2170 = serializers.IntegerField(source="mpcahcah012170_d_gd_val0")
    OP2180 = serializers.IntegerField(source="mpcahcah012180_d_gd_val0")
    OP2185 = serializers.IntegerField(source="mpcahcah012185_d_gd_val0")
    OP2190 = serializers.IntegerField(source="mpcahcah012190_d_gd_val0")
    OP2196 = serializers.IntegerField(source="mpcahcah012196_d_gd_val0")
    OP2210 = serializers.IntegerField(source="mpcahcah012210_d_gd_val0")
    OP2220 = serializers.IntegerField(source="mpcahcah012220_d_gd_val0")
    OP2225 = serializers.IntegerField(source="mpcahcah012225_d_gd_val0")
    OP2230 = serializers.IntegerField(source="mpcahcah012230_d_gd_val0")
    OP2236 = serializers.IntegerField(source="mpcahcah012236_d_gd_val0")
    OP2240 = serializers.IntegerField(source="mpcahcah012240_d_gd_val0")
    OP2250 = serializers.IntegerField(source="mpcahcah012250_d_gd_val0")
    OP2260 = serializers.IntegerField(source="mpcahcah012260_d_gd_val0")
    OP2270 = serializers.IntegerField(source="mpcahcah012270_d_gd_val0")
    OP2280 = serializers.IntegerField(source="mpcahcah012280_d_gd_val0")
    OP2290 = serializers.IntegerField(source="mpcahcah012290_d_gd_val0")
    OP2300 = serializers.IntegerField(source="mpcahcah012300_d_gd_val0")
    OP2310 = serializers.IntegerField(source="mpcahcah012310_d_gd_val0")
    OP2320 = serializers.IntegerField(source="mpcahcah012320_d_gd_val0")
    OP2325 = serializers.IntegerField(source="mpcahcah012325_d_gd_val0")
    OP2330 = serializers.IntegerField(source="mpcahcah012330_d_gd_val0")
    OP2340 = serializers.IntegerField(source="mpcahcah012340_d_gd_val0")
    OP2350 = serializers.IntegerField(source="mpcahcah012350_d_gd_val0")
    OP2355 = serializers.IntegerField(source="mpcahcah012355_d_gd_val0")
    OP2356 = serializers.IntegerField(source="mpcahcah012356_d_gd_val0")
    OP2360 = serializers.IntegerField(source="mpcahcah012360_d_gd_val0")
    OP2370 = serializers.IntegerField(source="mpcahcah012370_d_gd_val0")
    OP2380 = serializers.IntegerField(source="mpcahcah012380_d_gd_val0")
    OP2390 = serializers.IntegerField(source="mpcahcah012390_d_gd_val0")
    OP2400 = serializers.IntegerField(source="mpcahcah012400_d_gd_val0")
    OP2410 = serializers.IntegerField(source="mpcahcah012410_d_gd_val0")
    OP2420 = serializers.IntegerField(source="mpcahcah012420_d_gd_val0")
    OP2430 = serializers.IntegerField(source="mpcahcah012430_d_gd_val0")
    OP2440 = serializers.IntegerField(source="mpcahcah012440_d_gd_val0")
    OP2450 = serializers.IntegerField(source="mpcahcah012450_d_gd_val0")
    OP2460 = serializers.IntegerField(source="mpcahcah012460_d_gd_val0")
    OP2470 = serializers.IntegerField(source="mpcahcah012470_d_gd_val0")
    OP2475 = serializers.IntegerField(source="mpcahcah012475_d_gd_val0")
    OP2476 = serializers.IntegerField(source="mpcahcah012476_d_gd_val0")
    OP2480 = serializers.IntegerField(source="mpcahcah012480_d_gd_val0")
    OP2490 = serializers.IntegerField(source="mpcahcah012490_d_gd_val0")
    OP2505 = serializers.IntegerField(source="mpcahcah012505_d_gd_val0")
    OP2515 = serializers.IntegerField(source="mpcahcah012515_d_gd_val0")
    OP5010 = serializers.IntegerField(source="mpcahcah015010_d_gd_val0")
    OP5020 = serializers.IntegerField(source="mpcahcah015020_d_gd_val0")
    OP6010 = serializers.IntegerField(source="mpcahcah016010_d_gd_val0")
    OP7010 = serializers.IntegerField(source="mpcahcah017010_d_gd_val0")
    OP7020 = serializers.IntegerField(source="mpcahcah017020_d_gd_val0")
    OP7030 = serializers.IntegerField(source="mpcahcah017030_d_gd_val0")

    class Meta:
        model = GdAs01
        fields = [
            "timestamp",
            "timestamp_utc",
            "OP2006",
            "OP2010",
            "OP2020",
            "OP2030",
            "OP2040",
            "OP2050",
            "OP2055",
            "OP205a",
            "OP205b",
            "OP2060",
            "OP2070",
            "OP2080",
            "OP2090",
            "OP2100",
            "OP2110",
            "OP2115",
            "OP2120",
            "OP2135",
            "OP213a",
            "OP213b",
            "OP2140",
            "OP2145",
            "OP2146",
            "OP2150",
            "OP2155",
            "OP2160",
            "OP2170",
            "OP2180",
            "OP2185",
            "OP2190",
            "OP2196",
            "OP2210",
            "OP2220",
            "OP2225",
            "OP2230",
            "OP2236",
            "OP2240",
            "OP2250",
            "OP2260",
            "OP2270",
            "OP2280",
            "OP2290",
            "OP2300",
            "OP2310",
            "OP2320",
            "OP2325",
            "OP2330",
            "OP2340",
            "OP2350",
            "OP2355",
            "OP2356",
            "OP2360",
            "OP2370",
            "OP2380",
            "OP2390",
            "OP2400",
            "OP2410",
            "OP2420",
            "OP2430",
            "OP2440",
            "OP2450",
            "OP2460",
            "OP2470",
            "OP2475",
            "OP2476",
            "OP2480",
            "OP2490",
            "OP2505",
            "OP2515",
            "OP5010",
            "OP5020",
            "OP6010",
            "OP7010",
            "OP7020",
            "OP7030",
        ]


class LoopC_hourly_productionSerializer(serializers.ModelSerializer):
    timestamp = models.DateTimeField(blank=True, null=True)
    timestamp_utc = models.DateTimeField()

    OP3010 = serializers.IntegerField(source="mpcaccac013010_d_gd_val0")
    OP3020 = serializers.IntegerField(source="mpcaccac013020_d_gd_val0")
    OP303a = serializers.IntegerField(source="mpcaccac01303a_d_gd_val0")
    OP303b = serializers.IntegerField(source="mpcaccac01303b_d_gd_val0")
    OP3040 = serializers.IntegerField(source="mpcaccac013040_d_gd_val0")
    OP305a = serializers.IntegerField(source="mpcaccac01305a_d_gd_val0")
    OP305b = serializers.IntegerField(source="mpcaccac01305b_d_gd_val0")
    OP3060 = serializers.IntegerField(source="mpcaccac013060_d_gd_val0")
    OP3061 = serializers.IntegerField(source="mpcaccac013061_d_gd_val0")
    OP3062 = serializers.IntegerField(source="mpcaccac013062_d_gd_val0")
    OP3063 = serializers.IntegerField(source="mpcaccac013063_d_gd_val0")
    OP3070 = serializers.IntegerField(source="mpcaccac013070_d_gd_val0")
    OP3080 = serializers.IntegerField(source="mpcaccac013080_d_gd_val0")
    OP3090 = serializers.IntegerField(source="mpcaccac013090_d_gd_val0")
    OP3100 = serializers.IntegerField(source="mpcaccac013100_d_gd_val0")
    OP3105 = serializers.IntegerField(source="mpcaccac013105_d_gd_val0")
    OP3110 = serializers.IntegerField(source="mpcaccac013110_d_gd_val0")
    OP3120 = serializers.IntegerField(source="mpcaccac013120_d_gd_val0")

    class Meta:
        model = GdAs01
        fields = [
            "timestamp",
            "timestamp_utc",
            "OP3010",
            "OP3020",
            "OP303a",
            "OP303b",
            "OP3040",
            "OP305a",
            "OP305b",
            "OP3060",
            "OP3061",
            "OP3062",
            "OP3063",
            "OP3070",
            "OP3080",
            "OP3090",
            "OP3100",
            "OP3105",
            "OP3110",
            "OP3120",
        ]


class GdHistorySerializer(serializers.ModelSerializer):
    # production_date = serializers.CharField(source="production_date")
    # sub_area = serializers.CharField(source="sub_area")
    # equipment_id = serializers.IntegerField(source="equipment_id")
    # shift = serializers.IntegerField(source="shift")
    hour_01 = serializers.IntegerField(source="hour_1")
    hour_02 = serializers.IntegerField(source="hour_2")
    hour_03 = serializers.IntegerField(source="hour_3")
    hour_04 = serializers.IntegerField(source="hour_4")
    hour_05 = serializers.IntegerField(source="hour_5")
    hour_06 = serializers.IntegerField(source="hour_6")
    hour_07 = serializers.IntegerField(source="hour_7")
    hour_08 = serializers.IntegerField(source="hour_8")
    hour_09 = serializers.IntegerField(source="hour_9")
    # hour_10 = serializers.IntegerField(source="hour_10")
    # hour_11 = serializers.IntegerField(source="hour_11")
    # hour_12 = serializers.IntegerField(source="hour_12")
    # sum = serializers.IntegerField(source="sum")

    class Meta:
        model = GdHistory
        fields = [
            "production_date",
            "sub_area",
            "equipment_id",
            "shift",
            "hour_01",
            "hour_02",
            "hour_03",
            "hour_04",
            "hour_05",
            "hour_06",
            "hour_07",
            "hour_08",
            "hour_09",
            "hour_10",
            "hour_11",
            "hour_12",
            "sum",
        ]


class ScheduleDetailSerializer(serializers.ModelSerializer):
    class Meta:
        model = ScheduleDetail
        fields = [
            "sub_area",
            "production_date",
            "shift",
            "hour_start_time",
            "hour_end_time",
        ]


# class AndonPull,CallsSerializer(serializers.ModelSerializer):
#     class Meta:
#         model = AndonPullCalls
#         fields = [
#             "start_time",
#             "end_time",
#             "during_time",
#             "point_id",
#             "during_time1",
#             "sub_area",
#             "equipment_id",
#             "shift",
#             "call_type",
#         ]


# class Top20ShutdownSerializer(serializers.ModelSerializer):
#     class Meta:
#         model = Top20Shutdown
#         fields = [
#             "id",
#             "start_time",
#             "end_time",
#             "during_time",
#             "point_id",
#             "during_time1",
#             "sub_area",
#             "equipment_id",
#             "shift",
#             "call_type",
#         ]


# class production_totalSerializer(serializers.ModelSerializer):
#     class Meta:
#         model = ProductionTotal
#         fields = [
#             "production_date",
#             "shift",
#             "point_id",
#             "hour_1",
#             "hour_2",
#             "hour_3",
#             "hour_4",
#             "hour_5",
#             "hour_6",
#             "hour_7",
#             "hour_8",
#             "hour_9",
#             "hour_10",
#             "hour_11",
#             "hour_12",
#             "sum",
#         ]


# class MachineFaultHistorySerializer(serializers.ModelSerializer):
#     class Meta:
#         model = MachineFaultHistory
#         fields = [
#             "start_time",
#             "end_time",
#             "during_time",
#             "point_id",
#             "during_time1",
#             "sub_area",
#             "equipment_id",
#             "shift",
#             "call_type",
#         ]


class BK_M1_hourly_productionSerializer(serializers.ModelSerializer):
    timestamp = models.DateTimeField(blank=True, null=True)
    timestamp_utc = models.DateTimeField()

    M1_op003 = serializers.IntegerField(source="mpcbkcbk01003_d_gd_val0")
    M1_op005 = serializers.IntegerField(source="mpcbkcbk01005_d_gd_val0")
    M1_op010a = serializers.IntegerField(source="mpcbkcbk01010a_d_gd_val0")
    M1_op010b = serializers.IntegerField(source="mpcbkcbk01010b_d_gd_val0")
    M1_op020a = serializers.IntegerField(source="mpcbkcbk01020a_d_gd_val0")
    M1_op020b = serializers.IntegerField(source="mpcbkcbk01020b_d_gd_val0")
    M1_op030a = serializers.IntegerField(source="mpcbkcbk01030a_d_gd_val0")
    M1_op030b = serializers.IntegerField(source="mpcbkcbk01030b_d_gd_val0")
    M1_op040a = serializers.IntegerField(source="mpcbkcbk01040a_d_gd_val0")
    M1_op040b = serializers.IntegerField(source="mpcbkcbk01040b_d_gd_val0")
    M1_op050a = serializers.IntegerField(source="mpcbkcbk01050a_d_gd_val0")
    M1_op050b = serializers.IntegerField(source="mpcbkcbk01050b_d_gd_val0")
    M1_op060a = serializers.IntegerField(source="mpcbkcbk01060a_d_gd_val0")
    M1_op060b = serializers.IntegerField(source="mpcbkcbk01060b_d_gd_val0")
    M1_op070a = serializers.IntegerField(source="mpcbkcbk01070a_d_gd_val0")
    M1_op070b = serializers.IntegerField(source="mpcbkcbk01070b_d_gd_val0")
    M1_op075 = serializers.IntegerField(source="mpcbkcbk01075_d_gd_val0")
    M1_op080a = serializers.IntegerField(source="mpcbkcbk01080a_d_gd_val0")
    M1_op080b = serializers.IntegerField(source="mpcbkcbk01080b_d_gd_val0")
    M1_op090a = serializers.IntegerField(source="mpcbkcbk01090a_d_gd_val0")
    M1_op090b = serializers.IntegerField(source="mpcbkcbk01090b_d_gd_val0")
    M1_op100a = serializers.IntegerField(source="mpcbkcbk01100a_d_gd_val0")
    M1_op100b = serializers.IntegerField(source="mpcbkcbk01100b_d_gd_val0")
    M1_op110a = serializers.IntegerField(source="mpcbkcbk01110a_d_gd_val0")
    M1_op110b = serializers.IntegerField(source="mpcbkcbk01110b_d_gd_val0")
    M1_op120a = serializers.IntegerField(source="mpcbkcbk01120a_d_gd_val0")
    M1_op120b = serializers.IntegerField(source="mpcbkcbk01120b_d_gd_val0")
    M1_op125 = serializers.IntegerField(source="mpcbkcbk01125_d_gd_val0")
    M1_op140 = serializers.IntegerField(source="mpcbkcbk01140_d_gd_val0")
    M1_op150 = serializers.IntegerField(source="mpcbkcbk01150_d_gd_val0")
    M1_op160 = serializers.IntegerField(source="mpcbkcbk01160_d_gd_val0")
    M1_op170a = serializers.IntegerField(source="mpcbkcbk01170a_d_gd_val0")
    M1_op170b = serializers.IntegerField(source="mpcbkcbk01170b_d_gd_val0")
    M1_op180a = serializers.IntegerField(source="mpcbkcbk01180a_d_gd_val0")
    M1_op180b = serializers.IntegerField(source="mpcbkcbk01180b_d_gd_val0")
    M1_op190a = serializers.IntegerField(source="mpcbkcbk01190a_d_gd_val0")
    M1_op190b = serializers.IntegerField(source="mpcbkcbk01190b_d_gd_val0")
    M1_op195 = serializers.IntegerField(source="mpcbkcbk01195_d_gd_val0")
    M1_op200 = serializers.IntegerField(source="mpcbkcbk01200_d_gd_val0")
    M1_op210 = serializers.IntegerField(source="mpcbkcbk01210_d_gd_val0")
    M1_op230 = serializers.IntegerField(source="mpcbkcbk01230_d_gd_val0")
    M1_op245 = serializers.IntegerField(source="mpcbkcbk01245_d_gd_val0")
    M1_oplg01 = serializers.IntegerField(source="mpcbkcbk01lg01_d_gd_val0")
    M1_oplg02 = serializers.IntegerField(source="mpcbkcbk01lg02_d_gd_val0")

    class Meta:
        model = GdBk01
        fields = [
            "timestamp",
            "timestamp_utc",
            "M1_op003",
            "M1_op005",
            "M1_op010a",
            "M1_op010b",
            "M1_op020a",
            "M1_op020b",
            "M1_op030a",
            "M1_op030b",
            "M1_op040a",
            "M1_op040b",
            "M1_op050a",
            "M1_op050b",
            "M1_op060a",
            "M1_op060b",
            "M1_op070a",
            "M1_op070b",
            "M1_op075",
            "M1_op080a",
            "M1_op080b",
            "M1_op090a",
            "M1_op090b",
            "M1_op100a",
            "M1_op100b",
            "M1_op110a",
            "M1_op110b",
            "M1_op120a",
            "M1_op120b",
            "M1_op125",
            "M1_op140",
            "M1_op150",
            "M1_op160",
            "M1_op170a",
            "M1_op170b",
            "M1_op180a",
            "M1_op180b",
            "M1_op190a",
            "M1_op190b",
            "M1_op195",
            "M1_op200",
            "M1_op210",
            "M1_op230",
            "M1_op245",
            "M1_oplg01",
            "M1_oplg02",
        ]


class BK_M2_hourly_productionSerializer(serializers.ModelSerializer):
    timestamp = models.DateTimeField(blank=True, null=True)
    timestamp_utc = models.DateTimeField()

    M2_op003 = serializers.IntegerField(source="mpcbkcbk02003_d_gd_val0")
    M2_op005 = serializers.IntegerField(source="mpcbkcbk02005_d_gd_val0")
    M2_op010a = serializers.IntegerField(source="mpcbkcbk02010a_d_gd_val0")
    M2_op010b = serializers.IntegerField(source="mpcbkcbk02010b_d_gd_val0")
    M2_op020a = serializers.IntegerField(source="mpcbkcbk02020a_d_gd_val0")
    M2_op020b = serializers.IntegerField(source="mpcbkcbk02020b_d_gd_val0")
    M2_op030a = serializers.IntegerField(source="mpcbkcbk02030a_d_gd_val0")
    M2_op030b = serializers.IntegerField(source="mpcbkcbk02030b_d_gd_val0")
    M2_op040a = serializers.IntegerField(source="mpcbkcbk02040a_d_gd_val0")
    M2_op040b = serializers.IntegerField(source="mpcbkcbk02040b_d_gd_val0")
    M2_op050a = serializers.IntegerField(source="mpcbkcbk02050a_d_gd_val0")
    M2_op050b = serializers.IntegerField(source="mpcbkcbk02050b_d_gd_val0")
    M2_op060a = serializers.IntegerField(source="mpcbkcbk02060a_d_gd_val0")
    M2_op060b = serializers.IntegerField(source="mpcbkcbk02060b_d_gd_val0")
    M2_op070a = serializers.IntegerField(source="mpcbkcbk02070a_d_gd_val0")
    M2_op070b = serializers.IntegerField(source="mpcbkcbk02070b_d_gd_val0")
    M2_op075 = serializers.IntegerField(source="mpcbkcbk02075_d_gd_val0")
    M2_op080a = serializers.IntegerField(source="mpcbkcbk02080a_d_gd_val0")
    M2_op080b = serializers.IntegerField(source="mpcbkcbk02080b_d_gd_val0")
    M2_op090a = serializers.IntegerField(source="mpcbkcbk02090a_d_gd_val0")
    M2_op090b = serializers.IntegerField(source="mpcbkcbk02090b_d_gd_val0")
    M2_op100a = serializers.IntegerField(source="mpcbkcbk02100a_d_gd_val0")
    M2_op100b = serializers.IntegerField(source="mpcbkcbk02100b_d_gd_val0")
    M2_op110a = serializers.IntegerField(source="mpcbkcbk02110a_d_gd_val0")
    M2_op110b = serializers.IntegerField(source="mpcbkcbk02110b_d_gd_val0")
    M2_op120a = serializers.IntegerField(source="mpcbkcbk02120a_d_gd_val0")
    M2_op120b = serializers.IntegerField(source="mpcbkcbk02120b_d_gd_val0")
    M2_op125 = serializers.IntegerField(source="mpcbkcbk02125_d_gd_val0")
    M2_op140 = serializers.IntegerField(source="mpcbkcbk02140_d_gd_val0")
    M2_op150 = serializers.IntegerField(source="mpcbkcbk02150_d_gd_val0")
    M2_op160 = serializers.IntegerField(source="mpcbkcbk02160_d_gd_val0")
    M2_op170a = serializers.IntegerField(source="mpcbkcbk02170a_d_gd_val0")
    M2_op170b = serializers.IntegerField(source="mpcbkcbk02170b_d_gd_val0")
    M2_op180a = serializers.IntegerField(source="mpcbkcbk02180a_d_gd_val0")
    M2_op180b = serializers.IntegerField(source="mpcbkcbk02180b_d_gd_val0")
    M2_op190a = serializers.IntegerField(source="mpcbkcbk02190a_d_gd_val0")
    M2_op190b = serializers.IntegerField(source="mpcbkcbk02190b_d_gd_val0")
    M2_op195 = serializers.IntegerField(source="mpcbkcbk02195_d_gd_val0")
    M2_op200 = serializers.IntegerField(source="mpcbkcbk02200_d_gd_val0")
    M2_op210 = serializers.IntegerField(source="mpcbkcbk02210_d_gd_val0")
    M2_op230 = serializers.IntegerField(source="mpcbkcbk02230_d_gd_val0")
    M2_op245 = serializers.IntegerField(source="mpcbkcbk02245_d_gd_val0")

    class Meta:
        model = GdBk02
        fields = [
            "timestamp",
            "timestamp_utc",
            "M2_op003",
            "M2_op005",
            "M2_op010a",
            "M2_op010b",
            "M2_op020a",
            "M2_op020b",
            "M2_op030a",
            "M2_op030b",
            "M2_op040a",
            "M2_op040b",
            "M2_op050a",
            "M2_op050b",
            "M2_op060a",
            "M2_op060b",
            "M2_op070a",
            "M2_op070b",
            "M2_op075",
            "M2_op080a",
            "M2_op080b",
            "M2_op090a",
            "M2_op090b",
            "M2_op100a",
            "M2_op100b",
            "M2_op110a",
            "M2_op110b",
            "M2_op120a",
            "M2_op120b",
            "M2_op125",
            "M2_op140",
            "M2_op150",
            "M2_op160",
            "M2_op170a",
            "M2_op170b",
            "M2_op180a",
            "M2_op180b",
            "M2_op190a",
            "M2_op190b",
            "M2_op195",
            "M2_op200",
            "M2_op210",
            "M2_op230",
            "M2_op245",
        ]


class Ck_M1_hourly_productionSerializer(serializers.ModelSerializer):
    timestamp = models.DateTimeField(blank=True, null=True)
    timestamp_utc = models.DateTimeField()

    CK_M1_op008 = serializers.IntegerField(source="mpcckcck01008_d_gd_val0")
    CK_M1_op010a = serializers.IntegerField(source="mpcckcck01010a_d_gd_val0")
    CK_M1_op010b = serializers.IntegerField(source="mpcckcck01010b_d_gd_val0")
    CK_M1_op010g = serializers.IntegerField(source="mpcckcck01010g_d_gd_val0")
    CK_M1_op015a = serializers.IntegerField(source="mpcckcck01015a_d_gd_val0")
    CK_M1_op015b = serializers.IntegerField(source="mpcckcck01015b_d_gd_val0")
    CK_M1_op018 = serializers.IntegerField(source="mpcckcck01018_d_gd_val0")
    CK_M1_op020a = serializers.IntegerField(source="mpcckcck01020a_d_gd_val0")
    CK_M1_op020b = serializers.IntegerField(source="mpcckcck01020b_d_gd_val0")
    CK_M1_op020c = serializers.IntegerField(source="mpcckcck01020c_d_gd_val0")
    CK_M1_op020g = serializers.IntegerField(source="mpcckcck01020g_d_gd_val0")
    CK_M1_op030a = serializers.IntegerField(source="mpcckcck01030a_d_gd_val0")
    CK_M1_op030b = serializers.IntegerField(source="mpcckcck01030b_d_gd_val0")
    CK_M1_op030c = serializers.IntegerField(source="mpcckcck01030c_d_gd_val0")
    CK_M1_op040a = serializers.IntegerField(source="mpcckcck01040a_d_gd_val0")
    CK_M1_op040b = serializers.IntegerField(source="mpcckcck01040b_d_gd_val0")
    CK_M1_op040c = serializers.IntegerField(source="mpcckcck01040c_d_gd_val0")
    CK_M1_op040x = serializers.IntegerField(source="mpcckcck01040x_d_gd_val0")
    CK_M1_op045 = serializers.IntegerField(source="mpcckcck01045_d_gd_val0")
    CK_M1_op048 = serializers.IntegerField(source="mpcckcck01048_d_gd_val0")
    CK_M1_op050 = serializers.IntegerField(source="mpcckcck01050_d_gd_val0")
    CK_M1_op060a = serializers.IntegerField(source="mpcckcck01060a_d_gd_val0")
    CK_M1_op060b = serializers.IntegerField(source="mpcckcck01060b_d_gd_val0")
    CK_M1_op060c = serializers.IntegerField(source="mpcckcck01060c_d_gd_val0")
    CK_M1_op060g = serializers.IntegerField(source="mpcckcck01060g_d_gd_val0")
    CK_M1_op070a = serializers.IntegerField(source="mpcckcck01070a_d_gd_val0")
    CK_M1_op070b = serializers.IntegerField(source="mpcckcck01070b_d_gd_val0")
    CK_M1_op075 = serializers.IntegerField(source="mpcckcck01075_d_gd_val0")
    CK_M1_op080a = serializers.IntegerField(source="mpcckcck01080a_d_gd_val0")
    CK_M1_op080b = serializers.IntegerField(source="mpcckcck01080b_d_gd_val0")
    CK_M1_op080c = serializers.IntegerField(source="mpcckcck01080c_d_gd_val0")
    CK_M1_op090 = serializers.IntegerField(source="mpcckcck01090_d_gd_val0")
    CK_M1_op100a = serializers.IntegerField(source="mpcckcck01100a_d_gd_val0")
    CK_M1_op100b = serializers.IntegerField(source="mpcckcck01100b_d_gd_val0")
    CK_M1_op110a = serializers.IntegerField(source="mpcckcck01110a_d_gd_val0")
    CK_M1_op110b = serializers.IntegerField(source="mpcckcck01110b_d_gd_val0")
    CK_M1_op120 = serializers.IntegerField(source="mpcckcck01120_d_gd_val0")
    CK_M1_op130 = serializers.IntegerField(source="mpcckcck01130_d_gd_val0")
    CK_M1_op140 = serializers.IntegerField(source="mpcckcck01140_d_gd_val0")
    CK_M1_op150a = serializers.IntegerField(source="mpcckcck01150a_d_gd_val0")
    CK_M1_op150b = serializers.IntegerField(source="mpcckcck01150b_d_gd_val0")
    CK_M1_op150 = serializers.IntegerField(source="mpcckcck01150_d_gd_val0")

    class Meta:
        model = GdCk01
        fields = [
            "timestamp",
            "timestamp_utc",
            "CK_M1_op008",
            "CK_M1_op010a",
            "CK_M1_op010b",
            "CK_M1_op010g",
            "CK_M1_op015a",
            "CK_M1_op015b",
            "CK_M1_op018",
            "CK_M1_op020a",
            "CK_M1_op020b",
            "CK_M1_op020c",
            "CK_M1_op020g",
            "CK_M1_op030a",
            "CK_M1_op030b",
            "CK_M1_op030c",
            "CK_M1_op040a",
            "CK_M1_op040b",
            "CK_M1_op040c",
            "CK_M1_op040x",
            "CK_M1_op045",
            "CK_M1_op048",
            "CK_M1_op050",
            "CK_M1_op060a",
            "CK_M1_op060b",
            "CK_M1_op060c",
            "CK_M1_op060g",
            "CK_M1_op070a",
            "CK_M1_op070b",
            "CK_M1_op075",
            "CK_M1_op080a",
            "CK_M1_op080b",
            "CK_M1_op080c",
            "CK_M1_op090",
            "CK_M1_op100a",
            "CK_M1_op100b",
            "CK_M1_op110a",
            "CK_M1_op110b",
            "CK_M1_op120",
            "CK_M1_op130",
            "CK_M1_op140",
            "CK_M1_op150a",
            "CK_M1_op150b",
            "CK_M1_op150",
        ]


class HD_M1_hourly_productionSerializer(serializers.ModelSerializer):
    timestamp = models.DateTimeField(blank=True, null=True)
    timestamp_utc = models.DateTimeField()

    HD_M1_op003  = serializers.IntegerField(source="mpchdchd01003_d_gd_val0")
    HD_M1_op005  = serializers.IntegerField(source="mpchdchd01005_d_gd_val0")
    HD_M1_op010a = serializers.IntegerField(source="mpchdchd01010a_d_gd_val0")
    HD_M1_op010b = serializers.IntegerField(source="mpchdchd01010b_d_gd_val0")
    HD_M1_op020a = serializers.IntegerField(source="mpchdchd01020a_d_gd_val0")
    HD_M1_op020b = serializers.IntegerField(source="mpchdchd01020b_d_gd_val0")
    HD_M1_op030a = serializers.IntegerField(source="mpchdchd01030a_d_gd_val0")
    HD_M1_op030b = serializers.IntegerField(source="mpchdchd01030b_d_gd_val0")
    HD_M1_op040a = serializers.IntegerField(source="mpchdchd01040a_d_gd_val0")
    HD_M1_op040b = serializers.IntegerField(source="mpchdchd01040b_d_gd_val0")
    HD_M1_op050a = serializers.IntegerField(source="mpchdchd01050a_d_gd_val0")
    HD_M1_op050b = serializers.IntegerField(source="mpchdchd01050b_d_gd_val0")
    HD_M1_op060a = serializers.IntegerField(source="mpchdchd01060a_d_gd_val0")
    HD_M1_op060b = serializers.IntegerField(source="mpchdchd01060b_d_gd_val0")
    HD_M1_op065  = serializers.IntegerField(source="mpchdchd01065_d_gd_val0")
    HD_M1_op070  = serializers.IntegerField(source="mpchdchd01070_d_gd_val0")
    HD_M1_op080  = serializers.IntegerField(source="mpchdchd01080_d_gd_val0")
    HD_M1_op090  = serializers.IntegerField(source="mpchdchd01090_d_gd_val0")
    HD_M1_op100a = serializers.IntegerField(source="mpchdchd01100a_d_gd_val0")
    HD_M1_op100b = serializers.IntegerField(source="mpchdchd01100b_d_gd_val0")
    HD_M1_op110a = serializers.IntegerField(source="mpchdchd01110a_d_gd_val0")
    HD_M1_op110b = serializers.IntegerField(source="mpchdchd01110b_d_gd_val0")
    HD_M1_op120a = serializers.IntegerField(source="mpchdchd01120a_d_gd_val0")
    HD_M1_op120b = serializers.IntegerField(source="mpchdchd01120b_d_gd_val0")
    HD_M1_op130a = serializers.IntegerField(source="mpchdchd01130a_d_gd_val0")
    HD_M1_op130b = serializers.IntegerField(source="mpchdchd01130b_d_gd_val0")
    HD_M1_op140a = serializers.IntegerField(source="mpchdchd01140a_d_gd_val0")
    HD_M1_op140b = serializers.IntegerField(source="mpchdchd01140b_d_gd_val0")
    HD_M1_op145  = serializers.IntegerField(source="mpchdchd01145_d_gd_val0")
    HD_M1_op150  = serializers.IntegerField(source="mpchdchd01150_d_gd_val0")
    HD_M1_op160  = serializers.IntegerField(source="mpchdchd01160_d_gd_val0")
    HD_M1_op170a = serializers.IntegerField(source="mpchdchd01170a_d_gd_val0")
    HD_M1_op170b = serializers.IntegerField(source="mpchdchd01170b_d_gd_val0")
    HD_M1_op175  = serializers.IntegerField(source="mpchdchd01175_d_gd_val0")
    HD_M1_op178  = serializers.IntegerField(source="mpchdchd01178_d_gd_val0")
    HD_M1_op180  = serializers.IntegerField(source="mpchdchd01180_d_gd_val0")
    HD_M1_op190  = serializers.IntegerField(source="mpchdchd01190_d_gd_val0")
    HD_M1_op195  = serializers.IntegerField(source="mpchdchd01195_d_gd_val0")
    HD_M1_op205  = serializers.IntegerField(source="mpchdchd01205_d_gd_val0")

    class Meta:
        model = GdHd01
        fields = [
            "timestamp",
            "timestamp_utc",
            "HD_M1_op003", "HD_M1_op005", "HD_M1_op010a", "HD_M1_op010b", "HD_M1_op020a", "HD_M1_op020b", "HD_M1_op030a", "HD_M1_op030b", "HD_M1_op040a", "HD_M1_op040b", "HD_M1_op050a", "HD_M1_op050b", "HD_M1_op060a", "HD_M1_op060b", "HD_M1_op065", "HD_M1_op070", "HD_M1_op080", "HD_M1_op090", "HD_M1_op100a", "HD_M1_op100b", "HD_M1_op110a", "HD_M1_op110b", "HD_M1_op120a", "HD_M1_op120b", "HD_M1_op130a", "HD_M1_op130b", "HD_M1_op140a", "HD_M1_op140b", "HD_M1_op145", "HD_M1_op150", "HD_M1_op160", "HD_M1_op170a", "HD_M1_op170b", "HD_M1_op175", "HD_M1_op178", "HD_M1_op180", "HD_M1_op190", "HD_M1_op195", "HD_M1_op205",
        ]


class HD_M2_hourly_productionSerializer(serializers.ModelSerializer):
    timestamp = models.DateTimeField(blank=True, null=True)
    timestamp_utc = models.DateTimeField()

    HD_M2_op003  = serializers.IntegerField(source="mpchdchd02003_d_gd_val0")
    HD_M2_op005  = serializers.IntegerField(source="mpchdchd02005_d_gd_val0")
    HD_M2_op010a = serializers.IntegerField(source="mpchdchd02010a_d_gd_val0")
    HD_M2_op010b = serializers.IntegerField(source="mpchdchd02010b_d_gd_val0")
    HD_M2_op020a = serializers.IntegerField(source="mpchdchd02020a_d_gd_val0")
    HD_M2_op020b = serializers.IntegerField(source="mpchdchd02020b_d_gd_val0")
    HD_M2_op030a = serializers.IntegerField(source="mpchdchd02030a_d_gd_val0")
    HD_M2_op030b = serializers.IntegerField(source="mpchdchd02030b_d_gd_val0")
    HD_M2_op040a = serializers.IntegerField(source="mpchdchd02040a_d_gd_val0")
    HD_M2_op040b = serializers.IntegerField(source="mpchdchd02040b_d_gd_val0")
    HD_M2_op050a = serializers.IntegerField(source="mpchdchd02050a_d_gd_val0")
    HD_M2_op050b = serializers.IntegerField(source="mpchdchd02050b_d_gd_val0")
    HD_M2_op060a = serializers.IntegerField(source="mpchdchd02060a_d_gd_val0")
    HD_M2_op060b = serializers.IntegerField(source="mpchdchd02060b_d_gd_val0")
    HD_M2_op065  = serializers.IntegerField(source="mpchdchd02065_d_gd_val0")
    HD_M2_op070  = serializers.IntegerField(source="mpchdchd02070_d_gd_val0")
    HD_M2_op080  = serializers.IntegerField(source="mpchdchd02080_d_gd_val0")
    HD_M2_op090  = serializers.IntegerField(source="mpchdchd02090_d_gd_val0")
    HD_M2_op100a = serializers.IntegerField(source="mpchdchd02100a_d_gd_val0")
    HD_M2_op100b = serializers.IntegerField(source="mpchdchd02100b_d_gd_val0")
    HD_M2_op110a = serializers.IntegerField(source="mpchdchd02110a_d_gd_val0")
    HD_M2_op110b = serializers.IntegerField(source="mpchdchd02110b_d_gd_val0")
    HD_M2_op120a = serializers.IntegerField(source="mpchdchd02120a_d_gd_val0")
    HD_M2_op120b = serializers.IntegerField(source="mpchdchd02120b_d_gd_val0")
    HD_M2_op130a = serializers.IntegerField(source="mpchdchd02130a_d_gd_val0")
    HD_M2_op130b = serializers.IntegerField(source="mpchdchd02130b_d_gd_val0")
    HD_M2_op140a = serializers.IntegerField(source="mpchdchd02140a_d_gd_val0")
    HD_M2_op140b = serializers.IntegerField(source="mpchdchd02140b_d_gd_val0")
    HD_M2_op145  = serializers.IntegerField(source="mpchdchd02145_d_gd_val0")
    HD_M2_op150  = serializers.IntegerField(source="mpchdchd02150_d_gd_val0")
    HD_M2_op160  = serializers.IntegerField(source="mpchdchd02160_d_gd_val0")
    HD_M2_op170a = serializers.IntegerField(source="mpchdchd02170a_d_gd_val0")
    HD_M2_op170b = serializers.IntegerField(source="mpchdchd02170b_d_gd_val0")
    HD_M2_op175  = serializers.IntegerField(source="mpchdchd02175_d_gd_val0")
    HD_M2_op178  = serializers.IntegerField(source="mpchdchd02178_d_gd_val0")
    HD_M2_op180  = serializers.IntegerField(source="mpchdchd02180_d_gd_val0")
    HD_M2_op190  = serializers.IntegerField(source="mpchdchd02190_d_gd_val0")
    HD_M2_op195  = serializers.IntegerField(source="mpchdchd02195_d_gd_val0")
    HD_M2_op205  = serializers.IntegerField(source="mpchdchd02205_d_gd_val0")

    class Meta:
        model = GdHd02
        fields = [
            "timestamp",
            "timestamp_utc",
            "HD_M2_op003",
            "HD_M2_op005",
            "HD_M2_op010a",
            "HD_M2_op010b",
            "HD_M2_op020a",
            "HD_M2_op020b",
            "HD_M2_op030a",
            "HD_M2_op030b",
            "HD_M2_op040a",
            "HD_M2_op040b",
            "HD_M2_op050a",
            "HD_M2_op050b",
            "HD_M2_op060a",
            "HD_M2_op060b",
            "HD_M2_op065",
            "HD_M2_op070",
            "HD_M2_op080",
            "HD_M2_op090",
            "HD_M2_op100a",
            "HD_M2_op100b",
            "HD_M2_op110a",
            "HD_M2_op110b",
            "HD_M2_op120a",
            "HD_M2_op120b",
            "HD_M2_op130a",
            "HD_M2_op130b",
            "HD_M2_op140a",
            "HD_M2_op140b",
            "HD_M2_op145",
            "HD_M2_op150",
            "HD_M2_op160",
            "HD_M2_op170a",
            "HD_M2_op170b",
            "HD_M2_op175",
            "HD_M2_op178",
            "HD_M2_op180",
            "HD_M2_op190",
            "HD_M2_op195",
            "HD_M2_op205",
        ]
